<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>HexFiend: HFByteArray.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">HexFiend
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">HFByteArray.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_h_f_byte_array_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//  HFByteArray.h</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">//  HexFiend_2</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//  Copyright 2007 ridiculous_fish. All rights reserved.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#import &lt;Cocoa/Cocoa.h&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="keyword">@class</span> <a class="code" href="interface_h_f_byte_slice.html">HFByteSlice</a>, <a class="code" href="interface_h_f_progress_tracker.html">HFProgressTracker</a>, <a class="code" href="interface_h_f_file_reference.html">HFFileReference</a>, <a class="code" href="interface_h_f_byte_range_attribute_array.html">HFByteRangeAttributeArray</a>;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="_h_f_byte_array_8h.html#a2cd0cb024d2d0921ce5b5969370668e9">   12</a></span>&#160;<span class="keyword">typedef</span> NS_ENUM(NSUInteger, <a class="code" href="_h_f_byte_array_8h.html#a1af2563dbaa452271bb8d8967f2443be">HFByteArrayDataStringType</a>) {</div><div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="_h_f_byte_array_8h.html#a1af2563dbaa452271bb8d8967f2443bea19cf011438457f5556468df6a8c40721">   13</a></span>&#160;    <a class="code" href="_h_f_byte_array_8h.html#a1af2563dbaa452271bb8d8967f2443bea19cf011438457f5556468df6a8c40721">HFHexDataStringType</a>,</div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="_h_f_byte_array_8h.html#a1af2563dbaa452271bb8d8967f2443beaac306eadcbdc57022d9280aa1a808d81">   14</a></span>&#160;    <a class="code" href="_h_f_byte_array_8h.html#a1af2563dbaa452271bb8d8967f2443beaac306eadcbdc57022d9280aa1a808d81">HFASCIIDataStringType</a></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;};</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">@class</span> HFByteRangeAttributeArray;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="interface_h_f_byte_array.html">   36</a></span>&#160;<span class="keyword">@interface </span><a class="code" href="interface_h_f_byte_array.html">HFByteArray</a> : NSObject &lt;NSCopying, NSMutableCopying&gt; {</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">@private</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    NSUInteger changeLockCounter;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    NSUInteger <a class="code" href="interface_h_f_byte_array.html#afd62e6b3be8b05596494c5fbb7d7ea0f">changeGenerationCount</a>;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;}</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;- (instancetype)initWithByteSlice:(<a class="code" href="interface_h_f_byte_slice.html">HFByteSlice</a> *)slice;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;- (instancetype)initWithByteArray:(<a class="code" href="interface_h_f_byte_array.html">HFByteArray</a> *)array;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;- (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> long)<a class="code" href="interface_h_f_byte_array.html#ada079f9ec02547a52439f03d03c22491">length</a>;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;- (void)copyBytes:(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)dst range:(<a class="code" href="struct_h_f_range.html">HFRange</a>)range;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;- (NSArray *)<a class="code" href="interface_h_f_byte_array.html#ad5bc7decb596b958f03659fecc8ab2cf">byteSlices</a>;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;- (NSEnumerator *)<a class="code" href="interface_h_f_byte_array.html#a97980272d1583849b2ba0db9c3d28448">byteSliceEnumerator</a>;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;- (<a class="code" href="interface_h_f_byte_slice.html">HFByteSlice</a> *)sliceContainingByteAtIndex:(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span>)offset beginningOffset:(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> *)actualOffset;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;- (void)insertByteSlice:(<a class="code" href="interface_h_f_byte_slice.html">HFByteSlice</a> *)slice inRange:(<a class="code" href="struct_h_f_range.html">HFRange</a>)lrange;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;- (void)insertByteArray:(<a class="code" href="interface_h_f_byte_array.html">HFByteArray</a> *)array inRange:(<a class="code" href="struct_h_f_range.html">HFRange</a>)lrange;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;- (void)deleteBytesInRange:(<a class="code" href="struct_h_f_range.html">HFRange</a>)range;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;- (<a class="code" href="interface_h_f_byte_array.html">HFByteArray</a> *)subarrayWithRange:(<a class="code" href="struct_h_f_range.html">HFRange</a>)range;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;- (void)<a class="code" href="interface_h_f_byte_array.html#a521cf2a05fdafc70b3b78c4f2bfa05ad">incrementChangeLockCounter</a>;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;- (void)<a class="code" href="interface_h_f_byte_array.html#a48d930eebf0df5ec921678feadc84388">decrementChangeLockCounter</a>;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;- (BOOL)<a class="code" href="interface_h_f_byte_array.html#a7b940818a34e5fc956cc05aacdd6e200">changesAreLocked</a>;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="comment">/* @name Generation count</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="comment">   Manipulate the generation count */</span></div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="comment">// @{</span></div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="comment"></span>- (void)incrementGenerationOrRaiseIfLockedForSelector:(<span class="keywordtype">SEL</span>)sel;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;- (NSUInteger)<a class="code" href="interface_h_f_byte_array.html#afd62e6b3be8b05596494c5fbb7d7ea0f">changeGenerationCount</a>;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;- (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> long)indexOfBytesEqualToBytes:(<a class="code" href="interface_h_f_byte_array.html">HFByteArray</a> *)findBytes inRange:(<a class="code" href="struct_h_f_range.html">HFRange</a>)range searchingForwards:(BOOL)forwards trackingProgress:(HFProgressTracker *)progressTracker;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="keyword">@end</span></div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="category_h_f_byte_array_07_h_f_file_writing_08.html">  139</a></span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;<span class="keyword">@interface </span><a class="code" href="category_h_f_byte_array_07_h_f_file_writing_08.html">HFByteArray (HFFileWriting)</a></div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;- (BOOL)writeToFile:(NSURL *)targetURL trackingProgress:(HFProgressTracker *)progressTracker error:(NSError **)error;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;- (NSArray *)rangesOfFileModifiedIfSavedToFile:(HFFileReference *)reference;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;- (BOOL)clearDependenciesOnRanges:(NSArray *)ranges inFile:(HFFileReference *)reference hint:(NSMutableDictionary *)hint;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;<span class="keyword">@end</span></div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="category_h_f_byte_array_07_h_f_attributes_08.html">  168</a></span>&#160;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;<span class="keyword">@interface </span><a class="code" href="category_h_f_byte_array_07_h_f_attributes_08.html">HFByteArray (HFAttributes)</a></div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;- (HFByteRangeAttributeArray *)attributesForBytesInRange:(<a class="code" href="struct_h_f_range.html">HFRange</a>)range;</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;- (HFByteRangeAttributeArray *)<a class="code" href="category_h_f_byte_array_07_h_f_attributes_08.html#a9e7df21b4d7418dcfbb5e08dd08a3d13">byteRangeAttributeArray</a>;</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;<span class="keyword">@end</span></div><div class="ttc" id="interface_h_f_byte_array_html_a97980272d1583849b2ba0db9c3d28448"><div class="ttname"><a href="interface_h_f_byte_array.html#a97980272d1583849b2ba0db9c3d28448">-[HFByteArray byteSliceEnumerator]</a></div><div class="ttdeci">NSEnumerator * byteSliceEnumerator()</div></div>
<div class="ttc" id="interface_h_f_byte_array_html_a521cf2a05fdafc70b3b78c4f2bfa05ad"><div class="ttname"><a href="interface_h_f_byte_array.html#a521cf2a05fdafc70b3b78c4f2bfa05ad">-[HFByteArray incrementChangeLockCounter]</a></div><div class="ttdeci">void incrementChangeLockCounter()</div></div>
<div class="ttc" id="interface_h_f_file_reference_html"><div class="ttname"><a href="interface_h_f_file_reference.html">HFFileReference</a></div><div class="ttdoc">A reference to an open file. </div><div class="ttdef"><b>Definition:</b> HFFileReference.h:19</div></div>
<div class="ttc" id="_h_f_byte_array_8h_html_a1af2563dbaa452271bb8d8967f2443be"><div class="ttname"><a href="_h_f_byte_array_8h.html#a1af2563dbaa452271bb8d8967f2443be">HFByteArrayDataStringType</a></div><div class="ttdeci">HFByteArrayDataStringType</div><div class="ttdef"><b>Definition:</b> HFByteArray.h:12</div></div>
<div class="ttc" id="category_h_f_byte_array_07_h_f_attributes_08_html_a9e7df21b4d7418dcfbb5e08dd08a3d13"><div class="ttname"><a href="category_h_f_byte_array_07_h_f_attributes_08.html#a9e7df21b4d7418dcfbb5e08dd08a3d13">-[HFByteArray(HFAttributes) byteRangeAttributeArray]</a></div><div class="ttdeci">HFByteRangeAttributeArray * byteRangeAttributeArray()</div></div>
<div class="ttc" id="struct_h_f_range_html"><div class="ttname"><a href="struct_h_f_range.html">HFRange</a></div><div class="ttdoc">HFRange is the 64 bit analog of NSRange, containing a 64 bit location and length. ...</div><div class="ttdef"><b>Definition:</b> HFTypes.h:2</div></div>
<div class="ttc" id="interface_h_f_byte_array_html_afd62e6b3be8b05596494c5fbb7d7ea0f"><div class="ttname"><a href="interface_h_f_byte_array.html#afd62e6b3be8b05596494c5fbb7d7ea0f">-[HFByteArray changeGenerationCount]</a></div><div class="ttdeci">NSUInteger changeGenerationCount()</div></div>
<div class="ttc" id="interface_h_f_byte_range_attribute_array_html"><div class="ttname"><a href="interface_h_f_byte_range_attribute_array.html">HFByteRangeAttributeArray</a></div><div class="ttdoc">A class that represents sets of attributes, attached to ranges of bytes. </div><div class="ttdef"><b>Definition:</b> HFByteRangeAttributeArray.h:13</div></div>
<div class="ttc" id="interface_h_f_byte_array_html_ada079f9ec02547a52439f03d03c22491"><div class="ttname"><a href="interface_h_f_byte_array.html#ada079f9ec02547a52439f03d03c22491">-[HFByteArray length]</a></div><div class="ttdeci">unsigned long long length()</div></div>
<div class="ttc" id="interface_h_f_progress_tracker_html"><div class="ttname"><a href="interface_h_f_progress_tracker.html">HFProgressTracker</a></div><div class="ttdoc">A class that helps handle progress indication and cancellation for long running threaded operations...</div><div class="ttdef"><b>Definition:</b> HFProgressTracker.h:29</div></div>
<div class="ttc" id="interface_h_f_byte_array_html_a7b940818a34e5fc956cc05aacdd6e200"><div class="ttname"><a href="interface_h_f_byte_array.html#a7b940818a34e5fc956cc05aacdd6e200">-[HFByteArray changesAreLocked]</a></div><div class="ttdeci">BOOL changesAreLocked()</div></div>
<div class="ttc" id="category_h_f_byte_array_07_h_f_file_writing_08_html"><div class="ttname"><a href="category_h_f_byte_array_07_h_f_file_writing_08.html">HFByteArray(HFFileWriting)</a></div><div class="ttdoc">HFByteArray methods for writing to files, and preparing other HFByteArrays for potentially destructiv...</div><div class="ttdef"><b>Definition:</b> HFByteArray.h:139</div></div>
<div class="ttc" id="_h_f_byte_array_8h_html_a1af2563dbaa452271bb8d8967f2443bea19cf011438457f5556468df6a8c40721"><div class="ttname"><a href="_h_f_byte_array_8h.html#a1af2563dbaa452271bb8d8967f2443bea19cf011438457f5556468df6a8c40721">HFHexDataStringType</a></div><div class="ttdef"><b>Definition:</b> HFByteArray.h:13</div></div>
<div class="ttc" id="category_h_f_byte_array_07_h_f_attributes_08_html"><div class="ttname"><a href="category_h_f_byte_array_07_h_f_attributes_08.html">HFByteArray(HFAttributes)</a></div><div class="ttdoc">HFByteArray methods for attributes of byte arrays. </div><div class="ttdef"><b>Definition:</b> HFByteArray.h:168</div></div>
<div class="ttc" id="interface_h_f_byte_array_html_ad5bc7decb596b958f03659fecc8ab2cf"><div class="ttname"><a href="interface_h_f_byte_array.html#ad5bc7decb596b958f03659fecc8ab2cf">-[HFByteArray byteSlices]</a></div><div class="ttdeci">NSArray * byteSlices()</div></div>
<div class="ttc" id="interface_h_f_byte_array_html"><div class="ttname"><a href="interface_h_f_byte_array.html">HFByteArray</a></div><div class="ttdoc">The principal Model class for HexFiend&amp;#39;s MVC architecture. </div><div class="ttdef"><b>Definition:</b> HFByteArray.h:36</div></div>
<div class="ttc" id="interface_h_f_byte_slice_html"><div class="ttname"><a href="interface_h_f_byte_slice.html">HFByteSlice</a></div><div class="ttdoc">A class representing a source of data for an HFByteArray. </div><div class="ttdef"><b>Definition:</b> HFByteSlice.h:19</div></div>
<div class="ttc" id="_h_f_byte_array_8h_html_a1af2563dbaa452271bb8d8967f2443beaac306eadcbdc57022d9280aa1a808d81"><div class="ttname"><a href="_h_f_byte_array_8h.html#a1af2563dbaa452271bb8d8967f2443beaac306eadcbdc57022d9280aa1a808d81">HFASCIIDataStringType</a></div><div class="ttdef"><b>Definition:</b> HFByteArray.h:14</div></div>
<div class="ttc" id="interface_h_f_byte_array_html_a48d930eebf0df5ec921678feadc84388"><div class="ttname"><a href="interface_h_f_byte_array.html#a48d930eebf0df5ec921678feadc84388">-[HFByteArray decrementChangeLockCounter]</a></div><div class="ttdeci">void decrementChangeLockCounter()</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>
